<template>

</template>

<script>
    import echarts from 'echarts/lib/echarts';


    var chartDom = document.getElementById('main');
    var myChart = echarts.init(chartDom);
    var option;

    myChart.
    $.getJSON("../assets/123.json", function (graph) {
        myChart.hideLoading();

        option = {
            tooltip: {},
            legend: [{
                data: graph.categories.map(function (a) {
                    return a.name;
                })
            }],
            series: [
                {
                    name: 'Les Miserables',
                    type: 'graph',
                    layout: 'none',
                    data: graph.nodes,
                    links: graph.links,
                    categories: graph.categories,
                    roam: true,
                    label: {
                        show: true,
                        position: 'right',
                        formatter: '{b}'
                    },
                    labelLayout: {
                        hideOverlap: true
                    },
                    scaleLimit: {
                        min: 0.4,
                        max: 2
                    },
                    lineStyle: {
                        color: 'source',
                        curveness: 0.3
                    }
                }
            ]
        };

        myChart.setOption(option);
    });

    option && myChart.setOption(option);

    export default {
		name: "newVue"
	}
</script>

<style scoped>

</style>
